Take Method

Task Parallel System.Threading

Takes an item from the BlockingCollection<(Of <(T>)>).

Namespace:  System.Collections.Concurrent
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Function Take As T
C#
public T Take()

Return Value

The item removed from the collection.

Remarks

A call to Take()()() may block until an item is available to be removed.

Exceptions

ExceptionCondition
System..::.OperationCanceledExceptionThe BlockingCollection<(Of <(T>)>) is empty and has been marked as complete with regards to additions.
System..::.ObjectDisposedExceptionThe BlockingCollection<(Of <(T>)>) has been disposed.
System..::.InvalidOperationExceptionThe underlying collection was modified outside of this BlockingCollection<(Of <(T>)>) instance.

See Also